import React from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
// 鉴权组件
import AuthGuard from './auth';
// 导入其他页面组件
import AdminPage from '../pages/admin/adminPage';
import App from '../App';
import NotFound from '../pages/notFound/notFound';

import BigDataStatisticalAnalysis from '../pages/admin/bsp/bigDataStatisticalAnalysis/bigDataStatisticalAnalysis';
import TimeAnnouncementNotification from '../pages/admin/bsp/timeAnnouncementNotification';

import VisualTest from '../pages/visual/visualTest/visualTest';
import VisualBSP from '../pages/visual/visualBSP/visualBSP';
import VisualDRA from '../pages/visual/visualDRA/visualDRA';
import Cgp from '../pages/admin/cgp/cgp';

const AppRoutes: React.FC = () => {
  return (
    <Router>
        <Routes>
            {/* 登录页 - 公开访问 */}
            <Route path="/" element={<App />} />

            <Route path="/admin" element={<AuthGuard><AdminPage /></AuthGuard>}>
              <Route index element={<BigDataStatisticalAnalysis />} />
              <Route path="timeAnnouncementNotification" element={<TimeAnnouncementNotification />} />
              <Route path="cgp" element={<Cgp />} />
            </Route>

            <Route path="/visualTest" element={<VisualTest />} />
            <Route path="/visualBSP" element={<VisualBSP />} />
            <Route path="/visualDRA" element={<VisualDRA />} />
            <Route path="*" element={<NotFound />} />
        </Routes>
    </Router>
  );
};

export default AppRoutes;
